/******************************************************************************

    Copyright (C) 2019 ErisedMedia
    All Rights Reserved.

    This source code and any compilation or derivative thereof is the
    proprietary information of ErisedMedia and is
    confidential in nature.
    Under no circumstances is this software to be exposed to or placed under an
    Open Source License of any type without the expressed written permission of
    ErisedMedia.

******************************************************************************/

/******************************************************************************

    File:   Polygon.h
    Brief:  Polygon的头文件,多边形相关函数实现.

******************************************************************************/

/******************************************************************************

    Rev     Date        Author      Comments
--------------------------------------------------------------------------------
    001     20191206    RunyuanYe        Original

--------------------------------------------------------------------------------
    For consistency and standardisation retain the Section Separators.

*******************************************************************************/

#ifndef _POLYGON_
#define _POLYGON_

/******************************************************************************
*
*   INCLUDE FILES
*
******************************************************************************/

#include "Head.h"

/******************************************************************************
*
*   MACROS
*
******************************************************************************/


/******************************************************************************
*
*   TYPEDEFS
*
******************************************************************************/

//点结构体
typedef struct _Point_S {
    float x;
    float y;
} Point_S;

/******************************************************************************
*
*   EXPORT DATA
*
******************************************************************************/


/******************************************************************************
*
*   EXPORT FUNCTION PROTOTYPES
*
******************************************************************************/

// 计算多变形面积, 顶点要求逆时针
float PolygonArea(const std::vector<Point_S> polygon);

// 求两多边形相交的面积, 顶点要求逆时针
float PolygonIA(std::vector<Point_S> polygon1, std::vector<Point_S> polygon2);

#endif // _POLYGON_
